package org.JQbitorrentClinet.request.torrentmanagement;

import com.google.gson.reflect.TypeToken;
import lombok.Builder;
import org.JQbitorrentClinet.base.BaseGetUrlEncodedParam;
import org.JQbitorrentClinet.pojo.torrent.TorrentContent;

import java.util.List;

@Builder
public class GetTorrentContentsParam extends BaseGetUrlEncodedParam {

    String hash;
    String[] indexes;

    public GetTorrentContentsParam(String hash, String[] indexes) {
        super();
        this.hash = hash;
        this.indexes = indexes;
        this.responseType = new TypeToken<List<TorrentContent>>() {
        }.getType();
    }

    @Override
    public String getApiUrl() {
        return "/api/v2/torrents/files";
    }
}
